package main

import (
	"go-python/gorpc/handler"
	"go-python/gorpc/stup"
	"net"
	"net/rpc"
)

// type HelloService struct {
// }

// func (s *HelloService) Hello(request string, reply *string) error {
// 	*reply = "hello, " + request
// 	return nil
// }

func main() {
	listener, _ := net.Listen("tcp", ":1234")
	_ = stup.RegisterHelloService(&handler.HelloService{})
	// _ = rpc.RegisterName(handler.HelloServiceName, &handler.HelloService{})
	for {
		conn, _ := listener.Accept()
		go rpc.ServeConn(conn)
	}
}
